<!DOCTYPE html> 
<html> 
<head> 
	
	<title>海涛平价超市</title> 
	<Meta http-equiv="Content-Type" Content="text/html; Charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1"> 
<style type="text/css">
  body {
	font-family:"\5FAE\8F6F\96C5\9ED1", Helvetica;
	-webkit-text-size-adjust:none;
	font-size:16px;
	color:#4C64A0;
	background:#f8f8f8;
  }
  footer, header, nav {
	display:block;
	margin:0;
	padding:0;
  }
  #navs {position:fixed;top:0px;left:0x;z-index:999;background:#f8f8f8;}
  #navs a   {
    text-decoration:none;
	color:#4c5464;
    width:22%;
    height:37px;
    display:inline-block;
    line-height: 37px;
    text-align: center;
  }
  #foot {position:fixed;bottom:0px;left:0x;z-index:999;background:#f8f8f8;}
  #foot .f {
    text-align: center;
    height:37px;
    line-height: 37px;
    display:inline-block;
    width:45%;
  }
  table{border-collapse:collapse;width:100%;}
  table, td, th{border:1px solid black;}
  td,th{font-size:12px;}
</style>
</head> 
<body> 
<header><nav>
    <div id="navs" style="width:100%;">
    <a class="n1" href="weixin.php?r=index/maxDiscount">特价</a>
    <a class="n2" href="weixin.php?r=index/maxLove">热卖</a>
    <a class="n3" href="weixin.php?r=index/sales">活动</a>
    <a class="n4" href="weixin.php?r=index/all">全部</a>
    </div>
</nav></header>
<div style="height:37px;"></div>
<div id="main" style="width:100%;">
	<div id="good" >
		<table ><tr><th>商品</th><th>价格</th><th>购买数量</th><th>小计</th></tr>

		</table>
    </div>
	<div id="more" ></div>
</div>
<div style="height:37px;"></div>
<footer>
    <div id="foot" style="width:100%;">
    <span class="f">商品总计： </span><span class="f">提交 结算</span>
    </div>
</footer>
<script src="pages/js/weixin.js"></script>
<script>
    var page=1;
	var testdata;
    function gen(){
        $.get('weixin.php?r=index/getGood&p='+page, function(data){
            var html='';
			testdata=data;
			for(var i=0; i<data.length; i++){
				var item=data[i];
				html+='<tr><td colspan="4" style="color:blue;">'+item['name']+'</td></tr><tr><td style="width:60px;height:60px;"><img src="'+ item['pic_link'] +'" width=60 height=60 ></td><td style="text-align:center;">'+item['price']+'元</td><td style="width:30%;"><div style="width:32%;height:60px;line-height:60px;float:left;text-align:center;">-</div><div style="width:32%;height:60px;line-height:60px;float:left;text-align:center;border-width:0 1px 0 1px;border-style:solid;border-color:#EFE2E2">89</div><div style="width:32%;height:60px;line-height:60px;float:right;text-align:center;">+</div></td><td style="text-align:center;">￥89</td></tr>';
			}
			$('#good table').append($(html));
            page++;
        }, 'json');
    }
    $(document).ready(function(){
        gen();
    });
</script>
</body>
</html>

